

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>l5kit.rasterization.satellite_image module &mdash; L5Kit 1.0.0 documentation</title>
  

  
  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />

  
  
  
  

  
  <!--[if lt IE 9]>
    <script src="../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
        <script src="../_static/jquery.js"></script>
        <script src="../_static/underscore.js"></script>
        <script src="../_static/doctools.js"></script>
        <script src="../_static/language_data.js"></script>
    
    <script type="text/javascript" src="../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../index.html" class="icon icon-home" alt="Documentation Home"> L5Kit
          

          
          </a>

          
            
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul>
<li class="toctree-l1"><a class="reference internal" href="../README.html">ML Prediction, Planning and Simulation for Self-Driving</a></li>
<li class="toctree-l1"><a class="reference internal" href="../README.html#examples">Examples</a></li>
<li class="toctree-l1"><a class="reference internal" href="../README.html#news">News</a></li>
<li class="toctree-l1"><a class="reference internal" href="../README.html#overview">Overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="../README.html#installation">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../README.html#license">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="../README.html#credits">Credits</a></li>
<li class="toctree-l1"><a class="reference internal" href="../README.html#contact">Contact</a></li>
<li class="toctree-l1"><a class="reference internal" href="../api_reference.html">API Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="../data_format.html">Dataset Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="../how_to_contribute.html">How to contribute</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">L5Kit</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
        
      <li>l5kit.rasterization.satellite_image module</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="../_sources/API/l5kit.rasterization.satellite_image.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="module-l5kit.rasterization.satellite_image">
<span id="l5kit-rasterization-satellite-image-module"></span><h1>l5kit.rasterization.satellite_image module<a class="headerlink" href="#module-l5kit.rasterization.satellite_image" title="Permalink to this headline">¶</a></h1>
<dl class="py function">
<dt id="l5kit.rasterization.satellite_image.get_sat_image_crop">
<code class="sig-prename descclassname">l5kit.rasterization.satellite_image.</code><code class="sig-name descname">get_sat_image_crop</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">sat_image</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">crop_size</span><span class="p">:</span> <span class="n">Union<span class="p">[</span>Tuple<span class="p">[</span>int<span class="p">, </span>int<span class="p">]</span><span class="p">, </span>numpy.ndarray<span class="p">]</span></span></em>, <em class="sig-param"><span class="n">sat_pixel_translation</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">yaw</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>float<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.satellite_image.get_sat_image_crop" title="Permalink to this definition">¶</a></dt>
<dd><p>Crops input satellite such that <code class="docutils literal notranslate"><span class="pre">sat_pixel_translation</span></code> is centered in the image.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>sat_image</strong> (<em>np.ndarray</em>) – satellite image</p></li>
<li><p><strong>crop_size</strong> (<em>Union</em><em>[</em><em>Tuple</em><em>[</em><em>int</em><em>, </em><em>int</em><em>]</em><em>, </em><em>np.ndarray</em><em>]</em>) – size of desired crop in pixels</p></li>
<li><p><strong>sat_pixel_translation</strong> (<em>np.ndarray</em>) – 2D or 3D vector where to center the cropped image in pixels.</p></li>
</ul>
</dd>
<dt class="field-even">Keyword Arguments</dt>
<dd class="field-even"><p><strong>yaw</strong> (<em>Optional</em><em>[</em><em>float</em><em>]</em>) – yaw in radians, None or 0 means no rotation is applied to the output image.
default: {None})</p>
</dd>
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>a crop of input <code class="docutils literal notranslate"><span class="pre">sat_image</span></code></p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>(np.ndarray)</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="l5kit.rasterization.satellite_image.get_sat_image_crop_scaled">
<code class="sig-prename descclassname">l5kit.rasterization.satellite_image.</code><code class="sig-name descname">get_sat_image_crop_scaled</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">sat_image</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">crop_size</span><span class="p">:</span> <span class="n">Union<span class="p">[</span>Tuple<span class="p">[</span>int<span class="p">, </span>int<span class="p">]</span><span class="p">, </span>numpy.ndarray<span class="p">]</span></span></em>, <em class="sig-param"><span class="n">sat_pixel_translation</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">yaw</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>float<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em>, <em class="sig-param"><span class="n">sat_pixel_scale</span><span class="p">:</span> <span class="n">float</span> <span class="o">=</span> <span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">pixel_size</span><span class="p">:</span> <span class="n">float</span> <span class="o">=</span> <span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">interpolation</span><span class="p">:</span> <span class="n">int</span> <span class="o">=</span> <span class="default_value">1</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.satellite_image.get_sat_image_crop_scaled" title="Permalink to this definition">¶</a></dt>
<dd><dl class="simple">
<dt>Calls <cite>get_sat_image_crop</cite> (see that function’s docs for further details), and rescales taking</dt><dd><p>into account a desired pixel size.</p>
</dd>
</dl>
<p class="rubric">Example</p>
<p>Desired <code class="docutils literal notranslate"><span class="pre">crop_size</span></code> is 200x200, and <code class="docutils literal notranslate"><span class="pre">pixel_size</span></code> is 0.5: we want an image that corresponds
to 100x100 meters. This means it extracts a 33x33 image and scales it up to 200x200.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>sat_image</strong> (<em>np.ndarray</em>) – satellite image</p></li>
<li><p><strong>crop_size</strong> (<em>Union</em><em>[</em><em>Tuple</em><em>[</em><em>int</em><em>, </em><em>int</em><em>]</em><em>, </em><em>np.ndarray</em><em>]</em>) – size of desired crop in pixels</p></li>
<li><p><strong>sat_pixel_translation</strong> (<em>np.ndarray</em>) – 2D or 3D vector where to center the cropped image in pixels.</p></li>
</ul>
</dd>
<dt class="field-even">Keyword Arguments</dt>
<dd class="field-even"><ul class="simple">
<li><p><strong>yaw</strong> (<em>Optional</em><em>[</em><em>float</em><em>]</em>) – yaw in radians, 0 means no rotation is applied, which generally means up is North.
default: {None})</p></li>
<li><p><strong>sat_pixel_scale</strong> (<em>float</em>) – A <cite>sat_pixel_scale</cite> of 3.0 would means that every pixel in the sat</p></li>
<li><p><strong>corresponds to 3m in the real world.</strong><strong> (</strong><strong>default</strong> (<a class="reference internal" href="l5kit.geometry.image.html#module-l5kit.geometry.image" title="l5kit.geometry.image"><em>image</em></a>) – {1.0})</p></li>
<li><p><strong>pixel_size</strong> (<em>float</em>) – [description] (default: {1.0})</p></li>
<li><p><strong>interpolation</strong> (<em>int</em>) – [description] (default: {cv2.INTER_LINEAR})</p></li>
</ul>
</dd>
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>a crop of input <code class="docutils literal notranslate"><span class="pre">sat_image</span></code></p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>(np.ndarray)</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="l5kit.rasterization.satellite_image.get_sat_image_crop_scaled_from_ecef">
<code class="sig-prename descclassname">l5kit.rasterization.satellite_image.</code><code class="sig-name descname">get_sat_image_crop_scaled_from_ecef</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">sat_image</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">crop_size</span><span class="p">:</span> <span class="n">Union<span class="p">[</span>Tuple<span class="p">[</span>int<span class="p">, </span>int<span class="p">]</span><span class="p">, </span>numpy.ndarray<span class="p">]</span></span></em>, <em class="sig-param"><span class="n">ecef_translation</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">ecef_to_sat</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span><span class="p">:</span> <span class="n">Any</span></em><span class="sig-paren">)</span> &#x2192; numpy.ndarray<a class="headerlink" href="#l5kit.rasterization.satellite_image.get_sat_image_crop_scaled_from_ecef" title="Permalink to this definition">¶</a></dt>
<dd><p>Utility function, calls get_sat_image_crop_scaled, see that function for more details on additional
keyword arguments (such as <code class="docutils literal notranslate"><span class="pre">yaw</span></code>).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>sat_image</strong> (<em>np.ndarray</em>) – satellite image</p></li>
<li><p><strong>crop_size</strong> (<em>Union</em><em>[</em><em>Tuple</em><em>[</em><em>int</em><em>, </em><em>int</em><em>]</em><em>, </em><em>np.ndarray</em><em>]</em>) – size of desired crop in pixels</p></li>
<li><p><strong>ecef_translation</strong> (<em>np.ndarray</em>) – 2D or 3D vector where to center the cropped image</p></li>
<li><p><strong>ecef_to_sat</strong> (<em>np.ndarray</em>) – transform from ECEF to satellite image space</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>np.ndarray – a crop of satellite_image</p>
</dd>
</dl>
</dd></dl>

</div>


           </div>
           
          </div>
          <footer>
  

  <hr/>

  <div role="contentinfo">
    <p>
        
        &copy; Copyright 2020, Lyft Level 5

    </p>
  </div>
    
    
    
    Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
    
    <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
    
    provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>